#include "overflawtimes.h"
#include "ui_overflawtimes.h"
#include <QDebug>
OverFlawTimes::OverFlawTimes(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::OverFlawTimes)
{
    ui->setupUi(this);
    setWindowFlags(Qt::WindowStaysOnTopHint);
    ItemInit();
}

OverFlawTimes::~OverFlawTimes()
{
    delete ui;
}

void OverFlawTimes::ItemInit()
{
    for(int i=0;i<=9;i++)
    {
        ui->tableWidget->setItem(i,1,new QTableWidgetItem());
    }
}

void OverFlawTimes::UpDate()
{
    if(row!=nullptr)
    {
        for(int i=0;i<=9;i++)
        {
            if(i<=row->overflowDateTimeCount-1)
                ui->tableWidget->item(i,1)->setText(row->overflowDateTime[i].toString("yyyy-MM-dd hh:mm:ss"));
            else
                ui->tableWidget->item(i,1)->setText("");
        }
        ui->tableWidget->resizeColumnsToContents();
    }
}
